package com.rules.admin.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rules.admin.dao.DataDictModelDao;
import com.rules.admin.entity.DataDictModel;
import com.rules.admin.service.DataDictService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DataDictServiceImpl extends ServiceImpl<DataDictModelDao, DataDictModel> implements DataDictService {
   public IPage<DataDictModel> queryPage(String name, IPage<DataDictModel> page) {

      LambdaQueryWrapper<DataDictModel> queryWrapper = new LambdaQueryWrapper<>();
      if (StringUtils.isNotBlank(name)) {
         queryWrapper.like(DataDictModel::getDataName,"%" + name + "%");
      }
      return this.page(page, queryWrapper);
   }





   public List<DataDictModel> getAll() {
      return this.list();
   }
}
